home *** CD-ROM | disk | FTP | other *** search
/ Quarterdeck InternetSuite / Quarterdeck InternetSuite.iso / qsockpro.qip / XMISSION.MPS < prev    next >
Encoding:
Text File  |  1996-03-20  |  1.8 KB  |  83 lines

  1. # XMission PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 BPD
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON  
  14.  
  15. # reset maximum login timeout. 
  16.  
  17. SetTimeout      60             
  18.  
  19. # Get username from access method
  20. CfgGetValue "Username" username
  21.  
  22. # if the Username field is empty, prompt the user for it.
  23. IF result = 0 THEN
  24.     GetInput "Enter your user name" username
  25.     IF result = 0 THEN
  26.         PRINT "Warning, no username entered"
  27.     ELSE
  28.         PRINT "Username set to ["; username; "]"
  29.     ENDIF
  30. ENDIF
  31.  
  32. # get password from access method
  33. CfgGetValue "Password" password
  34.  
  35. # if the Password field is empty, prompt the user for it.
  36. IF result = 0 THEN
  37.     GetPassword "Enter your password" password
  38.     IF result = 0 THEN
  39.         PRINT "Warning, no password entered"
  40.     ELSE
  41.         PRINT "Password set."
  42.     ENDIF
  43. ENDIF
  44.  
  45. # get framing layer (MPPPP, MPSLIP)
  46. # abort with an error if we can't read the Framing setting
  47. CfgGetValue "Framing" framing
  48. IF result = 0 THEN
  49.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  50. ENDIF
  51.  
  52. CommWaitFor "Number:"        # wait for login prompt
  53.  
  54. # The character before the user name indicates the type of connection.
  55. IF framing = "MPPPP" THEN
  56.     CommSend "3"
  57. ENDIF
  58. IF framing = "MPSLIP" THEN
  59.     CommSend "4"
  60. ENDIF
  61.  
  62. CommSend "%r"                # send carriage return
  63.  
  64. CommWaitFor "Username:"
  65.     CommSend username
  66.     CommSend "%r"
  67.  
  68. CommWaitFor "Password:"
  69.     CommSend password
  70.     CommSend "%r"
  71.  
  72. IF framing = "MPSLIP" THEN
  73.     CommWaitFor "our address is"
  74.     CommReadIPAddr IPAddress
  75.     IF result>0 THEN
  76.         CfgSetValue "IPAddress" IPAddress
  77.         PRINT "%rIP Address set to ["; IPAddress; "]"
  78.     ENDIF
  79. ENDIF
  80.  
  81. END                             # indicate success if we got this far
  82.  
  83.